home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / obrn-a_1.5_up3.lha / src_upd3.lha / source / ol / OLStrings.mod < prev   
Encoding:
Text File  |  1995-03-13  |  5.6 KB  |  148 lines

  1. <* STANDARD- *> <* MAIN- *> <* INITIALISE- *>
  2.  
  3. MODULE OLStrings;
  4. (****************************************************************
  5.  
  6.    This file was created automatically by `FlexCat 1.5'
  7.    Do NOT edit by hand!
  8.    Oberon-A source description C 1994 by Albert Weinert
  9.    Using with Oberon-A Interfaces for AmigaOS Release 3.1
  10.    Modified for Oberon-A 1.5 by Frank Copeland
  11.  
  12.    Application: OLStrings
  13.    Language   : "english"
  14.    Version    : 1
  15.    Description: OBERON-A:Catalogs/OLStrings.cd
  16.  
  17. ****************************************************************)
  18.  
  19. IMPORT
  20.   lo := Locale, e := Exec, u := Utility, y := SYSTEM;
  21.  
  22. CONST
  23.   builtinlanguage = "english";
  24.   version = 1;
  25.  
  26. CONST
  27.   msg1* = 0;
  28.   msg2* = 1;
  29.   msg3* = 2;
  30.   msg4* = 3;
  31.   msg5* = 4;
  32.   msg6* = 5;
  33.   msg7* = 6;
  34.   msg8* = 7;
  35.   msg9* = 8;
  36.   msg10* = 9;
  37.   msg11* = 10;
  38.   msg12* = 11;
  39.   msg13* = 12;
  40.   msg14* = 13;
  41.   msg15* = 14;
  42.   msg16* = 15;
  43.   msg17* = 16;
  44.   msg18* = 17;
  45.   msg19* = 18;
  46.   msg20* = 19;
  47.   msg21* = 20;
  48.   msg22* = 21;
  49.   msg23* = 22;
  50.   msg24* = 23;
  51.   msg25* = 24;
  52.   msg26* = 25;
  53.   msg27* = 26;
  54.   msg28* = 27;
  55.   msg29* = 28;
  56.  
  57. TYPE
  58.   AppString = RECORD;
  59.      id  : LONGINT;
  60.      str : e.LSTRPTR;
  61.   END;
  62.   AppStringArray = ARRAY 29 OF AppString;
  63.  
  64. VAR
  65.   AppStrings : AppStringArray;
  66.   catalog : lo.CatalogPtr;
  67.  
  68.   PROCEDURE SetStrings;
  69.     BEGIN
  70.       AppStrings[0].id := msg1; AppStrings[0].str := y.ADR( " !! Could not open preferences file '%s'\n" );
  71.       AppStrings[1].id := msg2; AppStrings[1].str := y.ADR( " !! Too many search paths\n" );
  72.       AppStrings[2].id := msg3; AppStrings[2].str := y.ADR( " !! SYMSEARCH directory '%s' does not exist\n" );
  73.       AppStrings[3].id := msg4; AppStrings[3].str := y.ADR( " !! OBJSEARCH directory '%s' does not exist\n" );
  74.       AppStrings[4].id := msg5; AppStrings[4].str := y.ADR( " !! WITHPATH directory '%s' does not exist\n" );
  75.       AppStrings[5].id := msg6; AppStrings[5].str := y.ADR( " !! PROGPATH directory '%s' does not exist\n" );
  76.       AppStrings[6].id := msg7; AppStrings[6].str := y.ADR( " !! Too many extensions\n" );
  77.       AppStrings[7].id := msg8; AppStrings[7].str := y.ADR( "See OL.doc for conditions of use\n" );
  78.       AppStrings[8].id := msg9; AppStrings[8].str := y.ADR( " !! Could not create .with file name\n" );
  79.       AppStrings[9].id := msg10; AppStrings[9].str := y.ADR( "\x9B\x4B !! Name too long in '%s'\n" );
  80.       AppStrings[10].id := msg11; AppStrings[10].str := y.ADR( "\x9B\x4B !! Could not open '%s'\n" );
  81.       AppStrings[11].id := msg12; AppStrings[11].str := y.ADR( "\x9B\x4B !! Bad tag in symbol file '%s'\n" );
  82.       AppStrings[12].id := msg13; AppStrings[12].str := y.ADR( "\x9B\x4B !! Bad modAnchor in symbol file '%s'\n" );
  83.       AppStrings[13].id := msg14; AppStrings[13].str := y.ADR( "\x9B\x4B !! Bad name in symbol file '%s'\n" );
  84.       AppStrings[14].id := msg15; AppStrings[14].str := y.ADR( "\x9B\x4B !! Bad key in symbol file '%s'\n" );
  85.       AppStrings[15].id := msg16; AppStrings[15].str := y.ADR( "\x9B\x4B !! Could not find object file for module '%s'\n" );
  86.       AppStrings[16].id := msg17; AppStrings[16].str := y.ADR( "\x9B\x4B !! Could not find symbol file for module '%s'\n" );
  87.       AppStrings[17].id := msg18; AppStrings[17].str := y.ADR( "\x9B\x4B !! Bad key in module '%s'\n" );
  88.       AppStrings[18].id := msg19; AppStrings[18].str := y.ADR( "\x9B\x4B !! Could not create '%s'\n" );
  89.       AppStrings[19].id := msg20; AppStrings[19].str := y.ADR( " !! Error attempting to run '%s'\n" );
  90.       AppStrings[20].id := msg21; AppStrings[20].str := y.ADR( "\x9B\x4B !! Could not find object file '%s'\n" );
  91.       AppStrings[21].id := msg22; AppStrings[21].str := y.ADR( " !! Could not create program file name\n" );
  92.       AppStrings[22].id := msg23; AppStrings[22].str := y.ADR( " !! Too many arguments: select only one argument\n" );
  93.       AppStrings[23].id := msg24; AppStrings[23].str := y.ADR( " !! Arguments ALINK, BLINK and DLINK are mutually exclusive\n" );
  94.       AppStrings[24].id := msg25; AppStrings[24].str := y.ADR( " !! Arguments VERBOSE and QUIET are mutually exclusive\n" );
  95.       AppStrings[25].id := msg26; AppStrings[25].str := y.ADR( " !! Arguments MAKEICONS and NOICONS are mutually exclusive\n" );
  96.       AppStrings[26].id := msg27; AppStrings[26].str := y.ADR( " !! Could not create icon for '%s'\n" );
  97.       AppStrings[27].id := msg28; AppStrings[27].str := y.ADR( " !! Could not obtain icon\n" );
  98.       AppStrings[28].id := msg29; AppStrings[28].str := y.ADR( " !! Too few arguments: select exactly one argument\n" );
  99.     END SetStrings;
  100.  
  101.   PROCEDURE CloseCatalog*();
  102.     BEGIN
  103.       IF catalog # NIL THEN lo.CloseCatalog (catalog); catalog:=NIL END;
  104.    END CloseCatalog;
  105.  
  106.   PROCEDURE OpenCatalog*(loc:lo.LocalePtr; language:ARRAY OF CHAR);
  107.     VAR Tag : ARRAY 4 OF u.TagItem;
  108.     BEGIN
  109.       CloseCatalog();
  110.       IF (catalog = NIL) & (lo.base # NIL) THEN
  111.         Tag[0].tag := lo.builtInLanguage; Tag[0].data := y.ADR( builtinlanguage );
  112.         Tag[1].tag := u.ignore;           Tag[1].data := y.ADR( language );
  113.         Tag[2].tag := lo.version;         Tag[2].data := version;
  114.         Tag[3].tag := u.done;
  115.  
  116.         IF language # "" THEN
  117.           Tag[1].tag:= lo.language;
  118.         END;
  119.         catalog := lo.OpenCatalogA (loc, "OLStrings.catalog", Tag);
  120.       END;
  121.     END OpenCatalog;
  122.  
  123.   PROCEDURE GetString* (num: LONGINT): e.LSTRPTR;
  124.     VAR
  125.       i: LONGINT;
  126.       default: e.LSTRPTR;
  127.     BEGIN
  128.       i := 0; WHILE (i < 29) & (AppStrings[i].id # num) DO INC (i) END;
  129.  
  130.       IF i # 29 THEN
  131.         default := AppStrings[i].str;
  132.       ELSE
  133.         default := NIL;
  134.       END;
  135.  
  136.       IF catalog # NIL THEN
  137.         RETURN lo.GetCatalogStr (catalog, num, default^);
  138.       ELSE
  139.         RETURN default;
  140.       END;
  141.     END GetString;
  142.  
  143. BEGIN
  144.   catalog := NIL;
  145.   SetStrings;
  146. END OLStrings.
  147.  
  148.